package cn.stimd.spring.aop.support;

import cn.stimd.spring.aop.Pointcut;
import org.aopalliance.aop.Advice;

/**
 * Created by Stimd
 * 项目地址：https://gitee.com/stimd/spring-wheel
 * 公众号：Java编程探微
 */
public class DefaultPointcutAdvisor extends AbstractGenericPointcutAdvisor {
    private Pointcut pointcut = Pointcut.TRUE;

    public DefaultPointcutAdvisor() {}

    public DefaultPointcutAdvisor(Advice advice) {
        this(Pointcut.TRUE, advice);
    }

    public DefaultPointcutAdvisor(Pointcut pointcut, Advice advice) {
        this.pointcut = pointcut;
        setAdvice(advice);
    }

    public void setPointcut(Pointcut pointcut) {
        this.pointcut = pointcut;
    }

    @Override
    public Pointcut getPointcut() {
        return this.pointcut;
    }
}